<template>
	<view class="content">
		<view class="group">
			<view class="colmun" @tap="navTo('/pages/enter/password?title=修改密码')">
				<text>修改密码</text>
				<image src="../../../static/right.png" mode=""></image>
			</view>
			<view class="colmun" @tap="navTo('/pages/componentB/about/about?title=隐私政策及服务协议')">
				<text>隐私政策及服务协议</text>
				<image src="../../../static/right.png" mode=""></image>
			</view>
			<view class="colmun" @tap="navTo('/pages/componentB/about/about?title=联系我们')">
				<text>联系我们</text>
				<image src="../../../static/right.png" mode=""></image>
			</view>
			<view class="colmun" @tap="show = true">
				<text>退出登录</text>
				<image src="../../../static/right.png" mode=""></image>
			</view>
		</view>
		<u-modal v-model="show" :content="content" :show-cancel-button="true" confirm-text="退出" @confirm="logout()"></u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				content: '确定退出登录？'
			}
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url
				})
			},
			logout() {
				this.$store.commit('SAVE_USER', {
					avatar: "/static/logo.png"
				});
				uni.removeStorageSync('token')
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background: rgba(248, 248, 248, 1);
		padding: 30rpx;
		box-sizing: border-box;
	}

	.group {
		width: 690rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 10px;
		padding: 0 30rpx;
		box-sizing: border-box;

		.colmun {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 0;
			box-sizing: border-box;

			text {
				font-size: 15px;
				font-family: PingFang SC;
				font-weight: 500;
				color: rgba(102, 102, 102, 1);
			}

			image {
				width: 12rpx;
				height: 23rpx;
			}

			border-bottom: 1px solid rgba(0, 0, 0, .05);

			&:last-child {
				border: none;
			}
		}
	}
</style>
